home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / client / opers / JDAPSearchResponse.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-13  |  1.8 KB  |  74 lines

  1. package netscape.ldap.client.opers;
  2.  
  3. import java.io.IOException;
  4. import netscape.ldap.LDAPAttribute;
  5. import netscape.ldap.ber.stream.BERConstruct;
  6. import netscape.ldap.ber.stream.BERElement;
  7. import netscape.ldap.ber.stream.BEROctetString;
  8. import netscape.ldap.ber.stream.BERSequence;
  9. import netscape.ldap.ber.stream.BERTag;
  10.  
  11. public class JDAPSearchResponse implements JDAPProtocolOp {
  12.    protected String m_object_name;
  13.    protected BERElement m_element;
  14.    protected LDAPAttribute[] m_attributes;
  15.  
  16.    public JDAPSearchResponse(BERElement var1) throws IOException {
  17.       this.m_element = var1;
  18.       BERTag var2 = (BERTag)var1;
  19.       BERSequence var3 = (BERSequence)var2.getValue();
  20.       BEROctetString var4 = (BEROctetString)((BERConstruct)var3).elementAt(0);
  21.       Object var5 = null;
  22.       byte[] var9 = var4.getValue();
  23.       if (var9 == null) {
  24.          this.m_object_name = null;
  25.       } else {
  26.          try {
  27.             this.m_object_name = new String(var9, "UTF8");
  28.          } catch (Throwable var8) {
  29.          }
  30.       }
  31.  
  32.       BERSequence var6 = (BERSequence)((BERConstruct)var3).elementAt(1);
  33.       if (((BERConstruct)var6).size() > 0) {
  34.          this.m_attributes = new LDAPAttribute[((BERConstruct)var6).size()];
  35.  
  36.          for(int var7 = 0; var7 < ((BERConstruct)var6).size(); ++var7) {
  37.             this.m_attributes[var7] = new LDAPAttribute(((BERConstruct)var6).elementAt(var7));
  38.          }
  39.       }
  40.  
  41.    }
  42.  
  43.    public BERElement getBERElement() {
  44.       return this.m_element;
  45.    }
  46.  
  47.    public String getObjectName() {
  48.       return this.m_object_name;
  49.    }
  50.  
  51.    public LDAPAttribute[] getAttributes() {
  52.       return this.m_attributes;
  53.    }
  54.  
  55.    public int getType() {
  56.       return 4;
  57.    }
  58.  
  59.    public String toString() {
  60.       String var1 = "";
  61.       if (this.m_attributes != null) {
  62.          for(int var2 = 0; var2 < this.m_attributes.length; ++var2) {
  63.             if (var2 != 0) {
  64.                var1 = var1 + ",";
  65.             }
  66.  
  67.             var1 = var1 + this.m_attributes[var2].toString();
  68.          }
  69.       }
  70.  
  71.       return "SearchResponse {entry='" + this.m_object_name + "', attributes='" + var1 + "'}";
  72.    }
  73. }
  74.